# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-gvm
_pkgname=${pkgname/py3/python}
# follow the same version of gvm-tools
pkgver=24.7.0
pkgrel=0
pkgdesc="Greenbone Vulnerability Management Python Library "
url="https://github.com/greenbone/python-gvm"
arch="noarch"
license="GPL-3.0-or-later"
depends="python3 py3-paramiko py3-lxml py3-defusedxml py3-typing-extensions"
makedepends="py3-gpep517 py3-installer py3-poetry-core"
checkdepends="py3-defusedxml py3-pytest py3-lxml py3-paramiko py3-pontos"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/greenbone/$_pkgname/archive/v${pkgver/_/.}.tar.gz"
builddir="$srcdir/$_pkgname-${pkgver/_/.}"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	# hangs
	.testenv/bin/python3 -m pytest \
		--deselect=tests/connections/test_ssh_connection.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
6981c608c03dc448f455ae54fc97803dcc9491b637fac7e6fd42c620acf6f4c9e852dc315414516e2faa2bff2576551447f124849290cf77a70408d61f2449c1  py3-gvm-24.7.0.tar.gz
"
